/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package clienttest;

import java.util.HashSet;
import javax.sound.sampled.AudioFormat;
import javax.sound.sampled.AudioSystem;
import javax.sound.sampled.DataLine;
import javax.sound.sampled.Line;
import javax.sound.sampled.Mixer;

/**
 *
 * @author Yannick
 */
public class SupportedFormats {

    public static void main(String[] args) {
        HashSet<AudioFormat> inputFormats = new HashSet<AudioFormat>();
        HashSet<AudioFormat> outputFormats = new HashSet<AudioFormat>();
        Mixer.Info[] mixerInfo = AudioSystem.getMixerInfo();
        for (Mixer.Info i : mixerInfo)
        {
            System.out.println(i.toString());
        Mixer myMixer = AudioSystem.getMixer(i);
// Collect the input formats
        for (Line.Info lineInfo : myMixer.getSourceLineInfo()) {
            for (AudioFormat newFormat : ((DataLine.Info) lineInfo).getFormats()) {
                inputFormats.add(newFormat);
                System.out.println(newFormat.toString());
            }
        }

// Collect the output formats
        for (Line.Info lineInfo : myMixer.getTargetLineInfo()) {
            for (AudioFormat newFormat : ((DataLine.Info) lineInfo).getFormats()) {
                System.out.println(newFormat.toString());
            }
        }
        }


    }
}
